package org.benmaomao.webqq.resoureBundle;
import java.util.ResourceBundle;
import java.util.MissingResourceException;

/**
 * Utility Class with public static method for 
 * retrieving strings from the properties files 
 * @author  Yi Zhang
 * @version 1.0
 * @since 01/03/2009
 */
public class ResourceBundleUtility {
	//Common ResourceBundle
	private static ResourceBundle resourceBundle = ResourceBundle
	.getBundle("ApplicationProperties");

	/**
	 * Gets a string from the resource bundle. Returns the key if not found.
	 */
	public static String getResourceString(String key) {
		try {
			return resourceBundle.getString(key);
		} catch (MissingResourceException e) {
			return key;
		} catch (NullPointerException e) {
			return key;
		}
	}//end of method

}// end of class
}
